Carbon


SetMenuItemIconHandle

Header: Menus.h Carbon status: Supported

Sets a menu item’s icon.

OSErr SetMenuItemIconHandle (
    MenuHandle inMenu, 
    SInt16 inItem, 
    UInt8 inIconType, 
    Handle inIconHandle
);
inMenu

A handle to the menu that contains the menu item for which you wish to set an icon.

inItem

An integer representing the item number of the menu item.

inIconType

Pass a value representing the type of icon ('ICON', 'cicn', 'SICN', icon suite, or IconRef) you wish to attach; see “Menu Item Icon Type Constants” for descriptions of possible values.

inIconHandle

Pass a handle to the icon you wish to attach to a menu item.

function result

A result code.

DISCUSSION

The SetMenuItemIconHandle function sets the icon of a menu item with an icon handle instead of a resource ID. SetMenuItemIconHandle allows you to set icons of type 'ICON', 'cicn', 'SICN', as well as icon suites. To set resource-based icons for a menu item, call SetItemIcon.

Disposing of the menu will not dispose of the icon handles set by this function. To prevent memory leaks, your application should dispose of the icons when you dispose of the menu.

See also the function GetMenuItemIconHandle.

VERSION NOTES

This function is available with Appearance Manager 1.0 and later.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when CarbonLib 1.0 or later is installed. Exported by CarbonLib 1.0 and later and by CarbonLib 1.0 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)